﻿using System.Data;
using Migrator.Framework;


namespace Wayloop.Blog.DataAccess.Migrations
{
    // ReSharper disable InconsistentNaming
    [Migration(200904182346)]
    public class _200904182346_CreatePost : Migration
    {
        private const string TableName = "Post";


        public override void Up()
        {
            Database.AddTable(
                TableName,
                new Column("Id", DbType.Int64, ColumnProperty.PrimaryKeyWithIdentity),
                new Column("Slug", DbType.String, 100, ColumnProperty.NotNull | ColumnProperty.Unique),
                new Column("Title", DbType.String, 100, ColumnProperty.NotNull),
                new Column("Summary", DbType.String, 10000),
                new Column("Body", DbType.String, 10000),
                new Column("CreatedOn", DbType.DateTime, ColumnProperty.NotNull),
                new Column("ModifiedOn", DbType.DateTime, ColumnProperty.NotNull),
                new Column("PublishedOn", DbType.DateTime)
                );
        }


        public override void Down()
        {
            Database.RemoveTable(TableName);
        }
    }
}